<?php

namespace common\models;

use Yii;

/**
 * This is the model class for table "search_log".
 *
 * @property integer $id
 * @property string $session_id
 * @property integer $user_id
 * @property string $keyword
 * @property string $ip
 * @property integer $created_at
 * @property integer $updated_at
 */
class SearchLog extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'search_log';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_id', 'created_at', 'updated_at'], 'integer'],
            [['keyword', 'created_at', 'updated_at'], 'required'],
            [['session_id', 'keyword', 'ip'], 'string', 'max' => 255],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'session_id' => 'Session ID',
            'user_id' => 'User ID',
            'keyword' => 'Keyword',
            'ip' => 'Ip',
            'created_at' => 'Created At',
            'updated_at' => 'Updated At',
        ];
    }
}
